//
//  XDHttpTool.h
//  XDEducation
//
//  Created by apple on 2017/4/6.
//  Copyright © 2017年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface XDHttpTool : NSObject
/**
 *  POST请求 url中不带参数  params带参数
 *
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调（请将请求成功后想做的事情写到这个block中）
 *  @param failure 请求失败后的回调（请将请求失败后想做的事情写到这个block中）
 */
+ (NSURLSessionDataTask *)post:(NSString *)url params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;


+ (NSURLSessionDataTask *)post:(NSString *)url authCode:(NSString *)authCode params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;


+ (NSURLSessionDataTask *)get:(NSString *)url success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;


+ (NSURLSessionDataTask *)get:(NSString *)url params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;



+(NSURLSessionDataTask *)get:(NSString *)url authCode:(NSString *)authCode params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;

//上传图片
+(NSURLSessionDataTask *)uploadImage:(NSString *)url imageFilePath:(NSString *)iamgePath authCode:(NSString *)authCode params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;


//下载文件
+ (void)DownLoadFileWithUrlStr:(NSString *)UrlStr FileName:(NSString *)FileName Path:(NSString *)Path Progress:(void(^)(CGFloat))Progress Complete:(void(^)(NSString *FullPath,NSError *Err))Complete;


/** GEt该网络请求返回的数据没有经验过json封装 */
+ (void)SessGet:(NSString *)url authCode:(NSString *)authCode params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;

/** POST该网络请求返回的数据没有经验过json封装 */
+ (void)SessPost:(NSString *)url authCode:(NSString *)authCode params:(NSDictionary *)params success:(void(^)(id responseObj))success failure:(void(^)(NSError *error))failure;
@end
